package com.zHan.controller.utils;

public enum CodeEnum {
    // 增加
    SAVE_OK(20011,"添加成功^_^"),SAVE_ERR(20010,"添加失败QAQ"),
    // 删除
    DELETE_OK(20021,"删除成功^_^"),DELETE_ERR(20020,"删除失败QAQ"),
    // 修改
    UPDATE_OK(20031,"修改成功^_^"),UPDATE_ERR(20030,"修改失败QAQ"),
    // 查询
    GET_OK(20041),GET_ERR(20040,"数据查询失败，请重试"),
    // 异常 ---> 系统异常，用户操作异常，其他异常
    SYSTEM_ERR(50001),BUSINESS_ERR(50002),OTHER_ERR(59999);

    private Integer code;
    private String msg;


    //构造方法
    CodeEnum(Integer code) {
        this.code=code;
    }

    CodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int code() {
        return code;
    }

    public String msg() {
        return msg;
    }

}
